package uk.gov.swmprobation.cplitebase;

import android.app.Application;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;

public class MyApplication extends Application{
	
	public static String versionName;
	
    public void onCreate() {
        super.onCreate();
        DatabaseHandler.getInstance(this);
		try {
			PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
			versionName = pInfo.versionName;
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
    }
    
    private static MyApplication instance;

    public MyApplication() {
    	instance = this;
    }

    public static Context getContext() {
    	return instance;
    }
    
}
